package cn.wen233.order.api;

import cn.wen233.common.api.R;
import cn.wen233.common.infrustructure.exception.BaseException;
import cn.wen233.domain.Order;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wenei
 * @date 2021-06-05 14:13
 */
@RestController
@RequestMapping("/orders")
public class OrderApi {

    @GetMapping("/{id}")
    public R<?> getOrderById(@PathVariable String id) {
        throw new BaseException("查不到指定id的订单，因为未经过处理");
//        Order order = Order.builder()
//                .id(id)
//                .address("湖南长沙")
//                .description("看啥看,这是第2个服务")
//                .amount(2)
//                .build();
//        return R.success(order);
    }
}
